import time

from commons_util import Util
import pyautogui
import pyperclip
from datetime import datetime
from Account import AccountGenerator


# start point:0, 886
# end potion: 1201, 1576

class DailyMiss:
    def __init__(self):
        self.is_first = True

    def xiayi(self, judian_count, xianshi_count):
        account_generator = AccountGenerator()
        while account_generator.has_next():
            acc = account_generator.next()
            acc.switch_account()
            while acc.has_next_character():
                ch = acc.next_character()
                ch.switch_character()
                Util.click(995, 1009, 1)
                Util.click(882, 1130, 1)
                ch.reset(0)
                time.sleep(1)
                ch.reset(0)
                ch.enter_group()
                ch.get_leader()
                time.sleep(1)
                ch.xiayi_once(num_judian=judian_count, num_xianshi=xianshi_count)
                time.sleep(5)
                # 移交队长
                ch.put_leader()
                time.sleep(1)

    def zhenmo(self):
        account_generator = AccountGenerator()
        while account_generator.has_next():
            acc = account_generator.next()
            acc.switch_account()
            while acc.has_next_character():
                ch = acc.next_character()
                ch.switch_character()
                time.sleep(5)
                # Util.click(1097, 1252, 1)
                Util.click(995, 1009, 1)
                Util.click(882, 1130, 1)
                ch.reset(0)
                time.sleep(1)

                # 加入队伍，申请队长
                ch.reset(0)

                ch.enter_group()
                ch.get_leader()
                time.sleep(1)

                ch.zhenmo_once()
                time.sleep(5)

                # 移交队长
                ch.put_leader()
                time.sleep(1)


if __name__ == '__main__':
    dm = DailyMiss()
    # dm.xiayi_once(3, 3)
    # dm.test()
    # dm.xiayi(judian_count=3, xianshi_count=1)
    # dm.xiayi(judian_count=0, xianshi_count=1)
    # dm.xiayi(judian_count=0, xianshi_count=1)
    dm.zhenmo()
    # dm.zhenmo()
    # dm.main()
    # dm.inf_zhenmo()
